/**
 * 
 */
package com.yaodian100.ec.mailbanner.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

import com.yaodian100.core.common.entity.BaseEntity;

/**
 * 系统通知信广告礼券序号
 * @author matt.tsai
 */

@Entity
@Table(name = "EC_MAIL_BANNER_COUPON")
@NamedQueries( {
	@NamedQuery(name = "MailBannerCoupon.getFreeCoupon", query = "from MailBannerCoupon c where c.mailBannerId=:mailBannerId and c.publishDate is null and rownum=1 order by c.id") 
})
public class MailBannerCoupon extends BaseEntity {
	private static final long serialVersionUID = 1438576984214698653L;
	
	/**流水号*/
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_ec_mail_banner_coupon")
	@SequenceGenerator(name = "seq_ec_mail_banner_coupon", sequenceName = "SEQ_EC_MAIL_BANNER_COUPON")
	@Column(name = "ID")
	private Long id;
	
	/**ref. EC_MAIL_BANNER_MAIN.ID*/
	@Column(name="MAIL_BANNER_ID", nullable = false)
	private Long mailBannerId;
	
	/**礼券序号*/
	@Column(name = "COUPON_CODE", length = 255, nullable = false)
	private String couponCode;
	
	/**发放日期*/
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "PUBLISH_DATE")
	private Date publishDate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getMailBannerId() {
		return mailBannerId;
	}

	public void setMailBannerId(Long mailBannerId) {
		this.mailBannerId = mailBannerId;
	}

	public String getCouponCode() {
		return couponCode;
	}

	public void setCouponCode(String couponCode) {
		this.couponCode = couponCode;
	}

	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	
	
	

}
